package com.whc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whc.vo.Column;
import com.whc.vo.Table;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CommonMapper extends BaseMapper<Object> {
    Long saveOne(@Param("table") Table table);

    boolean saveMany(List<Table> tables);

    boolean updateManyById(List<Table> tables);

    boolean deleteById(List<Table> tables);

    @MapKey("tableName")
    Map<Object, Object> detailById(@Param("table") Table table);

    @MapKey("id")
    List<Map<Object, Object>> list(@Param("table") Table table, @Param("orders") List<Column> orders);

    @MapKey("id")
    Page<Map<Object, Object>> page(@Param("page") IPage<Map<Object, Object>> page, @Param("table") Table table, @Param("orders") List<Column> orders);
}
